package com.neusoft.resturant.service.impl;


import com.neusoft.resturant.common.utils.DateUtils;
import com.neusoft.resturant.entity.ResOrderdetails;
import com.neusoft.resturant.mapper.ResOrderdetailsMapper;
import com.neusoft.resturant.service.IResOrderdetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-10
 */
@Service
public class ResOrderdetailsServiceImpl implements IResOrderdetailsService
{
    @Autowired
    private ResOrderdetailsMapper resOrderdetailsMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public ResOrderdetails selectResOrderdetailsById(Long id)
    {
        return resOrderdetailsMapper.selectResOrderdetailsById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param resOrderdetails 订单
     * @return 订单
     */
    @Override
    public List<ResOrderdetails> selectResOrderdetailsList(ResOrderdetails resOrderdetails)
    {
        return resOrderdetailsMapper.selectResOrderdetailsList(resOrderdetails);
    }

    /**
     * 新增订单
     * 
     * @param resOrderdetails 订单
     * @return 结果
     */
    @Override
    public int insertResOrderdetails(ResOrderdetails resOrderdetails)
    {
        resOrderdetails.setCreateTime(DateUtils.getNowDate());
        return resOrderdetailsMapper.insertResOrderdetails(resOrderdetails);
    }

    /**
     * 修改订单
     * 
     * @param resOrderdetails 订单
     * @return 结果
     */
    @Override
    public int updateResOrderdetails(ResOrderdetails resOrderdetails)
    {
        resOrderdetails.setUpdateTime(DateUtils.getNowDate());
        return resOrderdetailsMapper.updateResOrderdetails(resOrderdetails);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteResOrderdetailsByIds(Long[] ids)
    {
        return resOrderdetailsMapper.deleteResOrderdetailsByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteResOrderdetailsById(Long id)
    {
        return resOrderdetailsMapper.deleteResOrderdetailsById(id);
    }
}
